package com.yangoxix.lovegoing.controller;

import com.yangoxix.lovegoing.page.ActivityPage;
import com.yangoxix.lovegoing.page.UserInfo;
import com.yangoxix.lovegoing.pojo.AuditUser;
import com.yangoxix.lovegoing.service.ManageActiviryService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: lovegoing
 * @description: 发布者管理活动
 * @author: chenzou
 * @create: 2021-09-19 14:05
 **/
@Controller
@RequestMapping("Manage")
@Api(tags="活动管理接口")
public class ManageActiviryController {

    @Autowired
    private ManageActiviryService service;

    @GetMapping("activity")
    @ResponseBody
    public List<ActivityPage> getActivityByUsername(String userName) {
        List<ActivityPage> activityPages = service.getActiviryByUsername(userName);
        return activityPages;
    }

    @GetMapping("getAuditUser")
    @ResponseBody
    public List<AuditUser> getAuditUser(String activityName) {
        List<AuditUser> auditUser = service.getAuditUser(activityName);
        return auditUser;
    }

    @GetMapping("getApplyedUser")
    @ResponseBody
    public ArrayList<UserInfo> getUserByActivityName(String activityName) {
        ArrayList<UserInfo> userByname = service.getUserByname(activityName);
        return userByname;
    }
}
